﻿using System.Net.Http;
using System.Threading.Tasks;

namespace AsyncTest;

class MainClass
{
    async static Task Main()
    {
        using HttpClient client = new();
        const string URL = "http://cn.bing.com";
        // 去掉await（同步模式运行），打印请求信息，加上await（异步模式），打印请求结果
        Console.WriteLine(await client.GetStringAsync(URL));
    }
}